package com.store.practice.service.impl;

import com.store.practice.dao.MemberMapper;
import com.store.practice.mapper.BgStoreMapper;
import com.store.practice.model.BgStore;
import com.store.practice.service.StoreManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StoreManageServiceImpl implements StoreManageService {
    @Autowired
    private BgStoreMapper storeMapper;


    @Override
    public BgStore list(Integer storeId,String name) {
        BgStore store = storeMapper.selectByPrimaryKey(storeId);
        if (!name.equals(store.getManager())){
            return null;
        }
        return store;
    }

    @Override
    public int update(BgStore store) {
        return storeMapper.updateByPrimaryKeySelective(store);
    }
}
